package com.cy.web;

import com.cy.Redis.CacheRedisService;
import com.cy.Service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
   private OrderService orderService;
    @Autowired
    private CacheRedisService redisService;
    @RequestMapping("/hello")
    public String hello(String orderID){
        System.out.println("hello---------"+orderID);
        return "hello"+orderID;
    }
    @RequestMapping("/downPay/{orderId}")
    public String downPay(@PathVariable(value = "orderId") String orderId){
        System.out.println("所下的订单ID为"+orderId);
        String msg =orderService.downPay(orderId);
        return msg;
    }

    @RequestMapping("/redisDemo")
    public String  redisDemo(){
        redisService.add("demo","2222");
        return "1";
    }
}
